import Tests.AmazonCodeTest;
import AbstractClases.AbstractAnimal;
import AbstractClases.Bear;
import AbstractClases.Tiger;
import Algorithms.BinarySearch;
import Algorithms.BubbleSort;
import Algorithms.InsertionSort;
import Algorithms.MergeSort;
import DataStructures.*;
import InterviewsExposed.HeadTailSingleLinkedList;
import InterviewsExposed.LinkedListOperations;
import InterviewsExposed.ListElement;
import InterviewsExposed.Recursion;
import InterviewsExposed.Search;
import InterviewsExposed.StringsAndArrays;


public class Execute {
	
	public static void main (String args[]){
		
//		Queue<String> queue = new Queue<String>();
//		queue.add("Hello");
//		queue.add("I");
//		queue.add("love");
//		queue.add("you");
//		queue.print();
//		
//		Stack <String> stack = new Stack <String>();
//		stack.push("Is");
//		stack.push("There");
//		stack.push("Anybody");
//		stack.push("Out");
//		stack.push("There?");
//		stack.print();
//		System.out.println("Popped" + stack.pop());
//		stack.print();
//		
//		int array []={5, 8, 12, 1, 4, 3, 9, 10, 2};
//		MergeSort merge = new MergeSort();
//		merge.sort(array);
//		merge.printRes();
//		
//		int array []={1, 3, 2, 14, 11, 19, 20, 34};
//		BubbleSort bubble = new BubbleSort();
//		bubble.sort(array);
//		bubble.printRes();
//	
//		int array []={1, 3, 2, 14, 11, 19, 20, 34};
//		InsertionSort insertion = new InsertionSort();
//		insertion.sort(array);
//			insertion.printRes();
//		
//		int array []= {2, 4, 5, 8, 11, 14, 33, 41, 47, 60};
//		BinarySearch binaryS = new BinarySearch();
//		System.out.println(binaryS.search(array, 14));
//		
//		Tiger tiger = new Tiger();
//		Bear bear = new Bear();
//		AbstractAnimal animal1 = tiger;
//		AbstractAnimal animal2 = bear;
//		animal1.eat();
//		animal2.eat();
//		animal1.die();
		
//		AmazonCodeTest test = new AmazonCodeTest();
//		int array[] = {4, 5, 6, 7, 8, 9, 10, 1, 2, 3};
//		System.out.print(test.findSortedArrayRotation(array));
		
//		ListElement head = new ListElement(3);
//		head = LinkedListOperations.insertInFront(head, 2);
//		head = LinkedListOperations.insertInFront(head, 1);
////		System.out.println("Found value: " + LinkedListOperations.find(head, 3).getData());
////		head = LinkedListOperations.delete(head, new ListElement(2));
////		LinkedListOperations.printLinkedList(head);
//		head = LinkedListOperations.insertAtEnd(head, 4);
//		LinkedListOperations.printLinkedList(head);
//		head = LinkedListOperations.reverseTheList(head);
//		LinkedListOperations.printLinkedList(head);
		
//		System.out.println(new Recursion().factorial(6));
//		System.out.println(new Recursion().factorialNoRecursive(6));
		
//		ListElement head = new ListElement(3);
//		head = LinkedListOperations.insertInFront(head, 2);
//		head = LinkedListOperations.insertInFront(head, 1);
//		LinkedListOperations.printLinkedList(head);
//		head = LinkedListOperations.reverseTheListNoRecursive(head);
//		LinkedListOperations.printLinkedList(head);
		
//		HeadTailSingleLinkedList list = new HeadTailSingleLinkedList();
//		list.insert(1);
//		list.insert(2);
//		list.insert(3);
//		list.insertAfter(new ListElement(3), 6);
//		LinkedListOperations.printLinkedList(list.getHead());
//		System.out.println("The tail: " + list.getTail().getData());
//		list.remove(new ListElement(6));
//		LinkedListOperations.printLinkedList(list.getHead());
//		System.out.println("The tail: " + list.getTail().getData());
		
//		ListElement cHead = LinkedListOperations.createCycledList();
//		ListElement head = new ListElement(3);
//		head = LinkedListOperations.insertInFront(head, 2);
//		head = LinkedListOperations.insertInFront(head, 1);
//		System.out.println(LinkedListOperations.isListCycled(cHead));
//		System.out.println(LinkedListOperations.isListCycled(head));
		
//		String word = "teetaerr";
//		System.out.println(StringsAndArrays.firstNonRepeated(word));
		
//		String res = StringsAndArrays.removeChars("Hola", "ol");
//		System.out.println(res);
		
//		System.out.println(StringsAndArrays.reverseSentence("Perrito tonto"));
		
//		System.out.println(StringsAndArrays.strToInt("10"));
//		System.out.println(StringsAndArrays.intToStr(-724));
		
		int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
		System.out.println(Search.binarySearch(array, 0, array.length, 4));
	}
}
